#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <ctime>

using namespace std;

/*typedef long long ll;
const ll M = 1000LL * 1000 * 1000 + 7;

inline void solve(const int n, const ll d, const int x, vector<ll>& res, vector<ll>& t){
	//cout << d << endl;
	if (d == 1) {
		fill(res.begin(), res.begin() + min(n, x) + 1, 1LL);
		fill(res.begin() + min(n, x) + 1, res.end(), 0LL);
		return;
	}
	solve(n, d / 2, x, t, res);
	fill(res.begin(), res.end(), 0);
	for (int i = 0; i <= n; ++i)
		for (int j = 0; j + i <= n; ++j){
		res[i + j] += 1LL * t[i] * t[j];
		}
	for (int i = 0; i < res.size(); ++i)
		res[i] %= M;
	if (d & 1){
		swap(res, t);
		fill(res.begin(), res.end(), 0);
		for (int i = 0; i <= n; ++i)
			for (int j = 0; j + i <= n && j <= min(n, x); ++j){
			res[i + j] += t[i];
			}
	}
	for (int i = 0; i < res.size(); ++i)
		res[i] %= M;
}


int main(){
	ios_base::sync_with_stdio(false);
	int n, x;
	ll d;
	
	
	for (int i = 0; i < 100; ++i){
		n = 2000; x = 2000;
		d = 1e12;
	//while (true){
		//cin >> n >> d >> x;
		--x;
		vector<ll> a(2001), b(2001);
		solve(n, d, x, a, b);
		cout << a[n];
	}
	return 0;
}*/
struct pt
{
	double x, y;
	pt(double x1 = 0, double y1 = 0){
		x = x1;
		y = y1;
	}
	friend pt operator - (pt a, pt b)
	{
		a.x -= b.x;
		a.y -= b.y;
		return a;
	}
	friend pt operator + (pt a, pt b)
	{
		a.x += b.x;
		a.y += b.y;
		return a;
	}
};
struct line{
	double a, b, c;
	bool l;
	line(){
		l = true;
	}
	line(pt q, pt w)
	{
		a = q.y - w.y;
		b = w.x - q.x;
		c = -a * q.x - b * q.y;
	}
};
pt line_line(line q, line w)
{
	pt ans;
	//cout << q.a << " " << q.b << " " << q.c << endl;
	//cout << w.a << " " << w.b << " " << w.c << endl;
	ans.y = (w.c * q.a - w.a * q.c) / (w.a * q.b - w.b * q.a);
	if (w.a == 0)
		swap(q, w);
	ans.x = (-w.c - w.b * ans.y) / w.a;
	return ans;
}
pt otr(pt p, line l)
{
	pt q = pt(l.a, l.b);
	double r = sqrt(q.x * q.x + q.y * q.y);
	q.x /= r;
	q.y /= r;
	double r1 = (p.x * l.a + p.y * l.b + l.c) / sqrt(l.a * l.a + l.b * l.b);
	q.x *= r1;
	q.y *= r1;
	pt p1 = p + q;
	if (fabs(p1.x * l.a + p1.y* l.b + l.c) > 1e-7)
	{
		q.x *= (-1);
		q.y *= (-1);
	}
	q.x *= 2;
	q.y *= 2;
	return p + q;
}


string S;
int ind;
int parseInt()
{
	int k = 1;
	if (S[ind] == '-')
	{
		k = k * (-1);
		++ind;
	}
	int ans = 0;
	while (ind != S.length() && S[ind] >= '0' && S[ind] <= '9')
	{
		ans = ans * 10 + S[ind] - '0';
		++ind;
	}
	ans *= k;
	return ans;
}
pt parsePt()
{
	pt p;
	++ind;
	p.x = parseInt();
	++ind;
	p.y = parseInt();
	++ind;
	return p;
}
line parse()
{
	line l;
	l.l = false;
	if (S[ind + 1] != '(')
	{
		pt p = parsePt();
		l.a = p.x;
		l.b = p.y;
		l.c = 0;
		l.l = false;
	}
	else
	{
		++ind;
		l = parse();
		++ind;
	}
	while (ind < S.length() && S[ind] == '@')
	{
		++ind;
		line l1;
		if (S[ind + 1] != '(')
		{
			pt p = parsePt();
			l1.a = p.x;
			l1.b = p.y;
			l1.c = 0;
			l1.l = false;
		}
		else
		{
			++ind;
			l1 = parse();
			++ind;
		}
		if (l.l  && l1.l)
		{
			pt p = line_line(l, l1);
			l.a = p.x;
			l.b = p.y;
			l.c = 0;
			l.l = false;
			continue;
		}
		if (!l.l && l1.l)
		{
			swap(l, l1);
		}
		if (l.l && !l1.l)
		{
			pt p = otr(pt(l1.a, l1.b), l);
			l.a = p.x;
			l.b = p.y;
			l.c = 0;
			l.l = false;
			continue;
		}
		if (!l.l && !l1.l)
		{
			line l2 = line(pt(l.a, l.b), pt(l1.a, l1.b));
			l2.l = true;
			l = l2;
			continue;
		}
		cout << "Oo" << endl;
	}
	return l;
}

int main()
{
	/*pt a, b;
	pt c, d;
	while (true)
	{
		cin >> a.x >> a.y;
		cin >> b.x >> b.y;
		cin >> c.x >> c.y;
		//cin >> d.x >> d.y;
		pt ans = otr(c, line(a, b));
		cout << ans.x << " " << ans.y << endl;
	}*/
	while (cin >> S)
	{
		if (S == "#")
			break;
		ind = 0;
		line ans = parse();
		cout.precision(18);
		cout << ans.a << " " << ans.b << endl;
	}
	return 0;
}